<?php
namespace App\Common\Cla\Weixin\OfficialAccount;

use App\Common as com;
use App\Common\Cla\Weixin\OfficialAccount as nameOfficialAccount;

class Jssdk extends nameOfficialAccount\Base\OfConfig {

	/**
	 * 构建配置
	 * @param array $APIs
	 * @return array
	 * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
	 * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
	 * @throws \EasyWeChat\Kernel\Exceptions\RuntimeException
	 * @throws \GuzzleHttp\Exception\GuzzleException
	 * @throws \Psr\SimpleCache\InvalidArgumentException
	 */
	public function buildConfig( array $APIs = [] ):array {
		// 自定义jssdk域名
		// $this->getEasyObj()->jssdk->setUrl( 'https://www.demo.com' );
		return $this->getEasyObj()->jssdk->buildConfig( $APIs, json: false );
	}

	/**
	 *
	 * @param string $prepayId
	 * @return array
	 */
	public function sdkConfig( string $prepayId ):array {
		return $this->getEasyObj()->jssdk->sdkConfig( $prepayId );
	}

}
